﻿<%@ Page Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="lvyou.aspx.cs"
    Inherits="map.lvyou" Title="无标题页" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="outstyle.css" rel="stylesheet" type="text/css" />
    <link href="Stylesheet1.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        #subcontent2 table
        {
            width: 100%;
            padding-bottom: 5px;
        }
        #subcontent2 td
        {
            width: 45px;
            padding-top: 3px;
        }
        #subcontent2 td a
        {
            color: Blue;
        }
    </style>

    <script src="js/dropdowncontent.js" type="text/javascript"></script>

    <style type="text/css">
        *
        {
            margin: 0px 0px 0px 0px;
            padding: 0px 0px 0px 0px;
        }
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 200px;
            vertical-align: top;
        }
        .itemcateSelectDiv, .shopcateSelectDiv
        {
            padding: 5px 0px 5px 0px;
            text-align: left;
        }
        .itemcateSelectDiv select, .shopcateSelectDiv select
        {
            width: 180px;
        }
        .itemcateSelectUl
        {
            list-style-type: none;
        }
        .ErrorMsgP
        {
            border: solid 1px red;
            background-color: #FFF2F2;
            width: 150px;
            margin-top: 3px;
        }
        .labelMarkerStyle
        {
            color: white;
            text-align: center;
            height: 21px;
            padding-top: 7px;
            position: relative;
            width: 50px;
        }
        .labelInfoWindowStyle
        {
            width: 200px;
            height: 200px;
            display: none;
        }
        div.labelMarkerCommDivRight
        {
            background: url(img/lable_mask_right_150x28.png) no-repeat;
            position: absolute;
            border: none;
            margin: 0px 0px 0px 0px;
            padding: 0px 0px 0px 0px;
            width: 150px;
            height: 28px;
            background-position: 0px 0px;
        }
        .labelMarkerCommSpan
        {
            line-height: 32px;
            vertical-align: middle;
            color: White;
        }
        #labelMarkerCanvasExtInfoWindow
        {
            background-color: lightGray;
            color: Red;
            position: relative;
            border: solid 1px blue;
            width: 325px;
            height: 50px;
        }
        .searchInputTextBox
        {
            background: url(img/glass.gif) no-repeat;
            padding-left: 20px;
        }
        #simple_example_window
        {
            width: 330px;
        }
        #simple_example_window_contents
        {
            background-color: #FFF;
        }
        #simple_example_window_beak
        {
            width: 28px;
        }
        * html #simple_example_window_beak
        {
            /* Alpha transparencies hack for IE */
            background-image: none; <%--filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src= 'images/corners/red_beak.png',sizingMethod='crop');--%>}
        #simple_example_window_close
        {
            width: 31px;
            height: 31px;
            background: url(  "img/close_20x20.png" ) left 10px no-repeat;
            cursor: pointer;
        }
        #simple_example_window_tl
        {
            background: url(  'img/panel.tl_15x15.png' ) no-repeat;
            width: 15px;
            height: 15px;
        }
        #simple_example_window_bl
        {
            background: url(  'img/panel.bl_15x15.png' ) no-repeat;
            width: 15px;
            height: 15px;
        }
        #simple_example_window_br
        {
            background: url(  'img/panel.br_15x15.png' ) no-repeat;
            width: 15px;
            height: 15px;
        }
        #simple_example_window_tr
        {
            background: url(  'img/panel.tr_15x15.png' ) no-repeat;
            width: 15px;
            height: 15px;
        }
        #simple_example_window_l
        {
            background: url(  'img/panel.l_15x15.png' );
            width: 15px;
        }
        #simple_example_window_r
        {
            background: url(  'img/panel.r_15x15.png' );
            width: 15px;
        }
        #simple_example_window_t
        {
            background: url(  'img/panel.t_15x15.png' );
        }
        #simple_example_window_b
        {
            background: url(  'img/panel.b_15x15.png' );
        }
    </style>

    <script src="http://ditu.google.cn/maps?file=api&amp;v=2&amp;key=ABQIAAAAA9MjP2TBxqYxBhVpW-OpKRRu9WK7kBr6UgG1CsdYn6QIvNE0PRSz6nmGnZgAI_mC8x2qRC7L3jK29Q"
        type="text/javascript"></script>

    <script src="js/dropdowncontent.js" type="text/javascript"></script>

    <script src="js/JScript1.js" type="text/javascript"></script>

    <script src="js/dom-drag.js" type="text/javascript"></script>

    <script type="text/javascript"> 
            //----设置Cookie------


        
        
 function selarea1(a) {      
    var result = AjaxFunction.Getselarea1(a) ;
    if(result!=null && result.value!=null)
    {
        document.getElementById("area4").innerHTML=result.value;
    }
}
function selarea2(a) {
    var result = AjaxFunction.Getselarea2(a);
    if (result != null && result.value != null) {
        var s = result.value.split("|");
        document.getElementById("ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder3_Label_currentposition").value = s[3];
        map.clearOverlays();
        map.setCenter(new GLatLng(s[2], s[1]), 14);
        var point1 = new GLatLng(s[2], s[1]);
        var marker1 = new GMarker(point1);
        GEvent.addListener(marker1, "click", function() {
            marker1.openInfoWindowHtml("标注此位置");
        });
        map.addOverlay(marker1);
        if (s[0] == "0") {
            var s1 = confirm("你还未登录,现在花半分钟注册以获得更好的用户体验?");
            if (s1 == true) {
                window.location.href = "member/regist1.aspx?area4id=" + a + "&long=" + s[1] + "&lat=" + s[2];
                return 0;
            }
        }
    }
}


    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="header">
        <div class="banner">
            <div class="logo">
                <a href="../default.aspx">
                    <img alt="藏宝网" src="/img/cbt.gif" style="width: 128px; height: 78px" />
                </a>
            </div>
            <div style="margin-top: 37px; float: left; margin-left: 10px">
                <div class="city" title="北京" id="currentProvinceDiv">
                    北京
                </div>
                <div class="city_selector" id="apf_id_5">
                    <div class="trigger">
                        <a class="switch" href="http://pages.f980.com/" id="contentlink" rel="subcontent2">[切换城市]</a></div>
                </div>
            </div>
            <div id="apf_id_6">
                <div class="corner_links">
                    <asp:HyperLink ID="HyperLink_login" runat="server">登录</asp:HyperLink>&nbsp;
                    <asp:HyperLink ID="HyperLink_logout" runat="server" NavigateUrl="/member/loginout.aspx">注销</asp:HyperLink>&nbsp;|&nbsp;
                    <a title="即时聊天" href="#" onclick="openChatRoom();">聊天</a> <a title="我的好友" href="/member/pfriends.aspx">
                        我的好友</a> <a title="我的店铺" href="/member/pshop.aspx">我的店铺</a> <a title="我的论坛" href="/member/pbbs.aspx">
                            我的论坛</a> <a title="我的博客" href="/member/pblog.aspx">我的博客</a> <a title="会员中心" id="content_member"
                                rel="DIV_member" href="member/pinfo.aspx" target="_blank">会员信息</a>
                </div>
            </div>
            <div style="clear: right">
            </div>
            <div class="tabbar">
                <div class="tabs">
                    <a title="商量购物" class="actived" style="padding-left: 0px; margin-left: 0px" href="lvyou.aspx">
                        旅 游</a> <a title="用于展示的一件商品." href="search/item.aspx">活 动</a> <a title="一个实体店铺" href="search/shop.aspx">
                            打 折</a> <a title="比较集中的区域,比如:中关村,木樨园等等." href="search/area.aspx">景 点</a>
                    <a title="" href="#">网 购</a> <a title="各地论坛" href="luntan/default.aspx">各地论坛</a>
                </div>
                <div class="bg">
                    <div class="nw">
                    </div>
                    <div class="cen">
                    </div>
                    <div class="cen">
                    </div>
                    <div class="cen">
                    </div>
                    <div class="cen">
                    </div>
                    <div class="ne">
                    </div>
                </div>
                <div style="clear: both">
                </div>
            </div>
            <div style="clear: both">
            </div>
        </div>
        <div class="bar">
            <div class="bleft">
            </div>
            <div class="bright">
            </div>
        </div>
    </div>
    <div id="subcontent2" style="position: absolute; visibility: hidden; border: 1px solid Gray;
        background-color: White; width: 210px; height: 170px; padding: 4px; z-index: 100;">
        <table>
            <tr>
                <td>
                    <a>安徽</a>
                </td>
                <td>
                    <a>北京</a>
                </td>
                <td>
                    <a>重庆</a>
                </td>
                <td>
                    <a>福建</a>
                </td>
                <td>
                    <a>甘肃</a>
                </td>
            </tr>
            <tr>
                <td>
                    <a>广东</a>
                </td>
                <td>
                    <a>广西</a>
                </td>
                <td>
                    <a>贵州</a>
                </td>
                <td>
                    <a>海南</a>
                </td>
                <td>
                    <a>河北</a>
                </td>
            </tr>
            <tr>
                <td>
                    <a>黑龙江</a>
                </td>
                <td>
                    <a>河南</a>
                </td>
                <td>
                    <a>湖北</a>
                </td>
                <td>
                    <a>湖南</a>
                </td>
                <td>
                    <a>江苏</a>
                </td>
            </tr>
            <tr>
                <td>
                    <a>江西</a>
                </td>
                <td>
                    <a>吉林</a>
                </td>
                <td>
                    <a>辽宁</a>
                </td>
                <td>
                    <a>内蒙古</a>
                </td>
                <td>
                    <a>宁夏</a>
                </td>
            </tr>
            <tr>
                <td>
                    <a>青海</a>
                </td>
                <td>
                    <a>山东</a>
                </td>
                <td>
                    <a>上海</a>
                </td>
                <td>
                    <a>山西</a>
                </td>
                <td>
                    <a>陕西</a>
                </td>
            </tr>
            <tr>
                <td>
                    <a>四川</a>
                </td>
                <td>
                    <a>天津</a>
                </td>
                <td>
                    <a>新疆</a>
                </td>
                <td>
                    <a>西藏</a>
                </td>
                <td>
                    <a>云南</a>
                </td>
            </tr>
            <tr>
                <td>
                    <a>浙江</a>
                </td>
                <td>
                    <a>香港</a>
                </td>
                <td>
                    <a>澳门</a>
                </td>
                <td>
                    <a>台湾</a>
                </td>
            </tr>
        </table>
        <div id="subcontent2CloseDiv" align="right">
            <a href="javascript:dropdowncontent.hidediv('subcontent2')">关闭</a></div>
    </div>
    <div id="DIV_member" style="position: absolute; visibility: hidden; border: 1px solid Gray;
        background-color: White; width: 65px; padding: 4px; z-index: 100;">
        <a href="member/pinfo.aspx">个人信息</a><br />
        <a href="member/pfriends.aspx">我的好友</a><br />
        <a href="member/pshop.aspx">我的店铺</a><br />
        <a href="member/pbbs.aspx">我的论坛</a><br />
        <a href="member/pblog.aspx">我的博客</a><br />
    </div>

    <script type="text/javascript" src="js/cookie.js"></script>

    <script type="text/javascript">

        dropdowncontent.init("contentlink", "right-bottom", 300, "click")
        dropdowncontent.init("content_member", "left-bottom", 300, "mouseover")

        function stateAnchorClick(o) {
            o = o || window.event;
            var thisObj = o.srcElement || o.target;
            var currentprovincediv = document.getElementById('currentProvinceDiv');
            //bug:在移动地图到其它省份，想在返回北京，当前位置与目标位置相同，不移动到目标位置的Bug，把判断注释
            //if (currentprovincediv.innerHTML != thisObj.innerHTML) {
            currentprovincediv.innerHTML = thisObj.innerHTML;
            currentprovincediv.title = "您当前的位置 " + thisObj.innerHTML;
            //var oldProvince = decodeURI(getCookie("f980", "area"));
            AjaxFunction.setCurrentState(thisObj.innerHTML);
            if (typeof (moveMapToAddress) != 'undefined') {   ///地图页面的跳转
                moveMapToAddress(thisObj.innerHTML);
            }
            dropdowncontent.hidediv('subcontent2')
            //}
        }
        
        function initAllProvince() {
            var subcontent2Div = document.getElementById("subcontent2");
            var tableEleList = subcontent2Div.getElementsByTagName("table");
            if (tableEleList.length > 0) {
                var aEleList = tableEleList[0].getElementsByTagName("a");
                for (var i = 0; i < aEleList.length; i++) {
                    aEleList[i].onclick = stateAnchorClick;
                    aEleList[i].href = "#";
                }
            }
        }
        function initCurrentProvince() {
            var currentProvince = "";
            var result = AjaxFunction.getCurrentState();
            if (result.value != null && result.value != "") {
                currentProvince = result.value; 
            }
            if (currentProvince == "") {
                currentProvince = "北京";
            }
            
            var currentProvincediv= document.getElementById("currentProvinceDiv");
            currentProvincediv.innerHTML = currentProvince;
            currentProvincediv.title = "您当前的位置 " + currentProvince;            
        }


        function init() {
            initAllProvince();
            initCurrentProvince();
        }

        init();

    </script>

    <table id="zyj" class="style1">
        <tr>
            <td class="style2">
                <div style="width: 200px;">
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            <%--<div style=" margin:2px 0px 2px 0px;">
                                搜索类别：
                                <select id="searchTypeSelect"  onchange ="searchTypeSelectChange(this);" style =" width:120px">
                                    <option value="Shop" selected="true">店铺</option>
                                    <option value="Item">商品</option>
                                </select><br />
                            </div>--%>
                            <div>                                   
                                <input type="radio" onclick="searchTypeRadioSelect();" id="searchTypeShopRadio" name="searchTypeRadio"
                                    value="Shop" checked="true" /><label for="searchTypeShopRadio">搜索活动</label>
                                &nbsp;&nbsp;&nbsp;&nbsp;
                                <input type="radio" onclick="searchTypeRadioSelect();" id="searchTypeItemRadio" name="searchTypeRadio"
                                    value="Item" /><label for="searchTypeItemRadio">搜索折扣</label>
                            </div>
                            <div id="searchButtonDiv">
                                <input  type="text" value="" class ="searchInputTextBox" id="TextBox_key" runat="server"  style=" width:130px;"/>
                                <input type="button" value="搜索" onclick="searchs();" />
                            </div>
                            <div id="SearchPriceDiv" style="display: none">
                                价格:<asp:TextBox ID="lowPriceTextBox" Text="0.0" runat="server" Width="73px"></asp:TextBox>-<asp:TextBox
                                    ID="highPriceTextBox" Text="0.0" runat="server" Width="82px"></asp:TextBox>
                            </div>
                            <div style="height: 5px;">
                            </div>
                            <div class="mapFinddingFilter_Caption">
                                实名信誉计划</div>
                            <div class="mapFinddingFilter_BoxTop">
                            </div>
                            <div class="mapFinddingFilter_BoxMiddle">
                                <table style="border-collapse: collapse; -webkit-border-horizontal-spacing: 0px;
                                    -webkit-border-vertical-spacing: 0px;">
                                    <tr>
                                        <td style="font-size: 12px; font-weight: 400; width: 77px; padding-top: 0px; padding-right: 0px;
                                            padding-bottom: 0px; padding-left: 0px;">
                                            <asp:CheckBox ID="RsmsCheckBox" runat="server" Text="如实描述" />
                                        </td>
                                        <td style="font-size: 12px; font-weight: 400; width: 77px; padding-top: 0px; padding-right: 0px;
                                            padding-bottom: 0px; padding-left: 0px;">
                                            <asp:CheckBox ID="QtthCheckBox" runat="server" Text="7 天退换" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="font-size: 12px; font-weight: 400; width: 77px; padding-top: 0px; padding-right: 0px;
                                            padding-bottom: 0px; padding-left: 0px;">
                                            <asp:CheckBox ID="ShwxCheckBox" runat="server" Text="30天维修" />
                                        </td>
                                        <td style="font-size: 12px; font-weight: 400; width: 77px; padding-top: 0px; padding-right: 0px;
                                            padding-bottom: 0px; padding-left: 0px;">
                                            <asp:CheckBox ID="SdfhCheckBox" runat="server" Text="闪电发货" />
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <div class="mapFinddingFilter_BoxBottom">
                            </div>
                            <div class="mapFinddingFilter_Caption">
                                分类:全部</div>
                            <div class="mapFinddingFilter_BoxTop">
                            </div>
                            <div class="mapFinddingFilter_BoxMiddle" style="padding-left: 2px; padding-right: 2px;
                                margin-right: 0px;">
                                <table style="border-collapse: collapse; -webkit-border-horizontal-spacing: 0px;
                                    width: 100%; -webkit-border-vertical-spacing: 0px;">
                                    <tr>
                                        <td style="font-size: 12px; font-weight: 400; width: 160px; padding-top: 0px; padding-right: 0px;
                                            padding-bottom: 0px; padding-left: 0px;">
                                            <div class="itemcateSelectDiv" style="display: none" id="itemcateSelectDiv">
                                                
                                                <ul class="itemcateSelectUl">
                                                    <li style="display: inline;">一级分类：
                                                        <select id="itemcateselect0" onchange="cateSelectChanged(this,0);">
                                                            <option value="">请选择商品分类</option>
                                                        </select>
                                                    </li>
                                                    <li style="display: none;">二级分类：
                                                        <select id="itemcateselect1" onchange="cateSelectChanged(this,1);">
                                                            <option value="">请选择商品分类</option>
                                                        </select>
                                                    </li>
                                                    <li style="display: none;">三级分类：
                                                        <select id="itemcateselect2" onchange="cateSelectChanged(this,2);">
                                                            <option value="">请选择商品分类</option>
                                                        </select>
                                                    </li>
                                                    <li style="display: none;">四级分类：
                                                        <select id="itemcateselect3" onchange="cateSelectChanged(this,3);">
                                                            <option value="">请选择商品分类</option>
                                                        </select>
                                                    </li>
                                                </ul>
                                            </div>
                                            <div class="shopcateSelectDiv" id="shopcateSelectDiv">
                                                店铺分类：<br />
                                                <select id="shopcateSelect0">
                                                    <option value="">请选择商品分类</option>
                                                </select>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <div class="mapFinddingFilter_BoxBottom">
                            </div>
                            <br />
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
            </td>
            <td style="width: 2px;">
            </td>
            <td style="vertical-align: top;">
                <div id="map_canvas" style="width: 100%; height: 600px; border-color: Gray; border-width: 1px;
                    border-style: solid;">
                </div>
            </td>
        </tr>
    </table>
    <div id="dragdivinmap" style="position: absolute; top: 100px; left: 275px; border-style: solid;
        border-width: 1px; border-color: #FAA041; background-color: #FCFBCC;">
        <img src="img/icon.idea_16x16.gif" />
        位置导航:<asp:Label ID="Label_currentposition" runat="server" Text="未定义"></asp:Label><a
            href="http://pages.f980.com/" id="contentlink3" rel="subcontent3" rev="selarea.aspx">[切换位置]</a>
    </div>
    <div id="subcontent3" style="position: absolute; visibility: hidden;  border: 1px solid Gray;
        background-color: White; width: 400px; height: 300px; padding: 4px; z-index: 100;
        overflow-y: scroll; filter: alpha(opacity=76); /*ie*/ 
          -moz-opacity: 0.76; /*moz , ff*/ 
          opacity: 0.76; /*css3, ff1.5*/">
    </div>

    <script src="js/extinfowindow_packed.js" type="text/javascript"></script>

    <script src="js/labeledmarker_packed.js" type="text/javascript"></script>

    <script type="text/javascript">
        dropdowncontent.init("contentlink3", "right-bottom", 300, "click");
    </script>

    <script type="text/javascript">
        var contentTemPrefix = "ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder3_";
        Drag.init(document.getElementById("dragdivinmap"));

        geocoder = window.geocoder || (new GClientGeocoder());
        map = window.map || (new GMap2(document.getElementById("map_canvas")));
        function moveMapToAddress(address) {
            if (geocoder) {
                geocoder.getLatLng(
                        (address == "吉林") ? "吉林省" : address,
                        function(point) {
                            if (!point) {
                                alert("不能解析: " + address);
                            } else {
                                map.setCenter(point, 10);
                                document.getElementById("contentlink3").rev = "selarea.aspx";
                            }
                        }
                );
            }
        }
        function moveMapToPlace() {
            var lat = 0;
            var lng = 0;
            var recid =  AjaxFunction.GetCurrentUserRECId().value;
            var result = AjaxFunction.getUserLocation(recid);
            if (result.value != null && result.value != "") {
                var user = eval("("+result.value+")");
                lat = user.lat;
                lng = user.lng;
            }
            var point = new GLatLng(lat, lng);
            map.setCenter(point, 13);
            var marker = new GMarker(point);
            map.addOverlay(marker);
        }

        function ShowCurrentState() {
            var result = AjaxFunction.getCurrentState().value;
            alert(result);
        }

        function initMapToUserLocation() {
            if (map) {
                var province = "";
                var result = AjaxFunction.getCurrentState();
                if (result.value != null && result.value != "") {
                    province = result.value;
                }
                if (province == "")
                    province = "北京";
                var zuserid = AjaxFunction.GetCurrentUserId() ;
                if (zuserid.value == "")
                {
                    moveMapToAddress(province);
                } else
                {
                    moveMapToPlace();
                }
            }            
        }

        window.onload = function() {
            searchTypeRadioSelect();
            initMapToUserLocation();
            initCateSelects("itemcateselect0", "");
            initShopCateSelect();
            mapUtil.init();
            searchs();
            //mapUtil.allowSearchs = true;

            setKeyDownSearch("ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder3_TextBox_key");
            setKeyDownSearch("ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder3_lowPriceTextBox");
            setKeyDownSearch("ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder3_highPriceTextBox");
        }
        
        //设置回车搜索功能
        function setKeyDownSearch(textId) {         
            var textEle = document.getElementById(textId);
            if (textEle != null && typeof (textEle .onkeydown)!=undefined ) {
                textEle.onkeydown = function(o) {
                    o = o || window.event;
                    if (o.keyCode == "13") {
                        searchs();
                        clearEventBubble(o);
                    }
                }
            }
        }
        
        



        

        
        //搜索
        function searchs() {
//            if (validateSearchKeys() == "") {
//                if (map) {
//                    map.closeExtInfoWindow();
//                    map.clearOverlays();
//                }
//                //搜索类型
//                var searchType = getSearchType();

//                //搜索关键字
//                var searchKeys = document.getElementById(resolveServerControlId("TextBox_key")).value;

//                //搜索价格
//                var lowPriceStr = document.getElementById(resolveServerControlId("lowPriceTextBox")).value;
//                var highPriceStr = document.getElementById(resolveServerControlId("highPriceTextBox")).value;
//                var lowPrice =(Number)(lowPriceStr);
//                lowPrice = (lowPrice.toString().toUpperCase() != "NAN") ? lowPrice : 0;
//                var highPrice = (Number)(highPriceStr);
//                highPrice = (highPrice.toString().toUpperCase() != "NAN") ? highPrice : 100000000;

//                //消费者保障
//                var rsmsValue = getCustomerWarrantValue("RsmsCheckBox");
//                var qtthValue = getCustomerWarrantValue("QtthCheckBox");
//                var shwxValue = getCustomerWarrantValue("ShwxCheckBox");
//                var sdfhValue = getCustomerWarrantValue("SdfhCheckBox");

//                //当前 左右经纬度
//                var bounds = map.getBounds();
//                var southWest = bounds.getSouthWest();
//                var northEast = bounds.getNorthEast();
//                var rightLat = southWest.lat();
//                var leftLng = southWest.lng();
//                var rightLng = northEast.lng();
//                var leftLat = northEast.lat();

//                //获取分类
//                var currentcate = getCurrentCate();

//                var searchResult = AjaxFunction.searchs(searchType ,searchKeys, leftLat , leftLng ,  rightLat ,  rightLng ,
//                            rsmsValue, qtthValue, shwxValue, sdfhValue, currentcate, lowPrice, highPrice);
//                if (searchResult.value != null && searchResult.value != "") {
//                    var searchList = eval(searchResult.value);
//                    for (var i = 0; i < searchList.length; i++) {
//                        mapUtil.createLabelMarker(searchList[i], searchType, searchKeys,
//                            rsmsValue, qtthValue, shwxValue, sdfhValue, currentcate, lowPrice, highPrice);
//                    }
//                }
//            } 
        }


       
        function getSearchType() {
            var searchTypeRadios = document.getElementsByName("searchTypeRadio");
            for (var i = 0; i < searchTypeRadios.length; i++) {
                if (searchTypeRadios[i].checked == true)
                    return searchTypeRadios[i].value;
            }  
            return "Shop";
        }
        function resolveServerControlId(id) {
            return contentTemPrefix + id;
        }

        mapUtil = window.mapUtil || {};
        mapUtil = {
            _searchTimeOut: null,
            _infoWindowTimeOut: null,
            commDiv: null,
            allowSearchs: false,
            createLabelMarker: function(obj, itemOrShop, searchKeys,
                            rsmsValue, qtthValue, shwxValue, sdfhValue, currentcate, lowPrice, highPrice) {
                if (map) {
                    var icon = new GIcon();
                    icon.image = 'img/lable_normal_50x40.png';
                    icon.iconSize = new GSize(50, 40);
                    icon.iconAnchor = new GPoint(25, 40);
                    icon.infoWindowAnchor = new GPoint(20, 0);
                    var _title = "";
                    var _labelText = "";
                    if (itemOrShop == "Item") {
                        _title = "在 " + obj.area + " 共找到" + obj.count.toString() + "个商品";
                        _labelText = "<span>" + obj.count.toString() + " </span>个";
                    }
                    else {
                        _title = "在 " + obj.area + " 共找到" + obj.count.toString() + "家店铺";
                        _labelText = "<span>" + obj.count.toString() + " </span>家";
                    }

                    opts = {
                        "icon": icon,
                        "clickable": true,
                        "title": _title,
                        "labelText": _labelText,
                        "labelOffset": new GSize(-25, -40),
                        "labelClass": "labelMarkerStyle"
                    };
                    var marker = new LabeledMarker(new GLatLng(obj.lat, obj.lng), opts);

                    GEvent.addListener(marker, "click", function() {
                        mapUtil.hideCommDiv();
                        mapUtil.hoverMarker(marker, false);
                        marker.openExtInfoWindow(
                          map,
                          "simple_example_window",
                          "<div>" + obj.area + "</div><div>loading...</div>"
                        );
                        map.savePosition();
                        mapUtil._infoWindowTimeOut = window.setTimeout(function() {
                            mapUtil.updateCanvasExtInfoWindow(marker, obj, itemOrShop, searchKeys,
                            rsmsValue, qtthValue, shwxValue, sdfhValue, currentcate, lowPrice, highPrice)
                        }, parseInt(obj.count / 50) * 500 + 500);

                    });
                    GEvent.addListener(marker, "mouseover", function() {
                        var point = map.fromLatLngToContainerPixel(marker.getLatLng());
                        mapUtil.updateCommDivName(point.y, point.x, obj.area);
                        mapUtil.hoverMarker(marker, true);
                    });
                    GEvent.addListener(marker, "mouseout", function() {
                        mapUtil.hideCommDiv();
                        mapUtil.hoverMarker(marker, false);
                    });
                    map.addOverlay(marker);
                }
            },
            init: function() {
                this.commDiv = document.createElement("div");
                this.commDiv.className = "labelMarkerCommDivRight";
                this.commDiv.style.visibility = "hidden";
                document.body.appendChild(this.commDiv);
                if (map) {
                    GEvent.addListener(map, "dragstart", function() {
                        mapUtil.allowSearchs = false;
                    });
                    GEvent.addListener(map, "dragend", function() {
                        mapUtil.allowSearchs = true;
                        mapUtil.fireSearch();
                    });
                    GEvent.addListener(map, "zoomstart", function() {
                        mapUtil.allowSearchs = false;
                    });
                    GEvent.addListener(map, "zoomend", function() {
                        mapUtil.allowSearchs = true;
                        mapUtil.fireSearch();
                    });
                    GEvent.addListener(map, "movestart", function() {
                    });
                    GEvent.addListener(map, "moveend", function() {
                        mapUtil.fireSearch();
                    });
                    GEvent.addListener(map, "extinfowindowopen", function() {
                        mapUtil.allowSearchs = false;
                        clearTimeout(mapUtil._infoWindowTimeOut);
                    });
                    GEvent.addListener(map, "extinfowindowclose", function() {
                        mapUtil.allowSearchs = true;
                        map.returnToSavedPosition();
                    });
                }
            },
            updateCommDivName: function(top, left, name) {
                var mapCovas = document.getElementById("map_canvas");
                this.commDiv.innerHTML = "";
                var spanEle = document.createElement("span");
                spanEle.innerHTML = name;
                spanEle.style.height = "28px";
                spanEle.className = "labelMarkerCommSpan";
                this.commDiv.appendChild(spanEle);
                this.commDiv.style.left = left + mapCovas.offsetLeft + 20 + "px";
                this.commDiv.style.top = top + mapCovas.offsetTop - 39 + "px";
                this.commDiv.style.width = name.length * 7 + 20 + "px";
                this.commDiv.style.visibility = "visible";
                this.commDiv.style.backgroundPosition = (name.length * 7 + 20) - 150 + "px 0px";

            },
            hoverMarker: function(marker, isHide) {
                if (isHide == true) {
                    marker.setImage("img/lable_hover_50x40.png");
                    var zIndex = GOverlay.getZIndex(-90);
                    marker.div_.style.zIndex = zIndex;
                    this.commDiv.style.zIndex = zIndex + 1;
                    try {
                        marker.yr.style.zIndex = zIndex
                    } catch (C) {
                    }
                    map.disableDragging();
                }
                else {
                    marker.setImage("img/lable_normal_50x40.png");
                    var zIndex = GOverlay.getZIndex(marker.getLatLng().lat());
                    marker.div_.style.zIndex = zIndex;
                    try {
                        marker.yr.style.zIndex = zIndex;
                    } catch (C) {
                    }
                    map.enableDragging()
                }
            },
            hideCommDiv: function() {
                this.commDiv.innerHTML = "";
                this.commDiv.style.visibility = "hidden";
            },
            updateCanvasExtInfoWindow: function(marker, pointObj, itemOrShop, searchKeys,
                            rsmsValue, qtthValue, shwxValue, sdfhValue, currentcate, lowPrice, highPrice) {
                var height = ((pointObj.count >= 4) ? 320 : 200);
                var iframeSrc = "";
                if (itemOrShop == "Item") {
                    iframeSrc = "pointItem.aspx";
                }
                else {
                    iframeSrc = "pointShop.aspx";
                }
                iframeSrc += "?lat=" + pointObj.lat.toString() + "&lng=" + pointObj.lng.toString() + "&area=" +encodeURI ( pointObj.area);
                iframeSrc += "&searchKeys=" +encodeURI ( searchKeys) + "&rsmsValue=" + rsmsValue + "&qtthValue=" + qtthValue + "&shwxValue=" + shwxValue;
                iframeSrc += "&sdfhValue=" + sdfhValue + "&currentCate=" + currentcate + "&lowPrice=" + lowPrice + "&highPrice=" + highPrice;

                map.closeExtInfoWindow();
                marker.openExtInfoWindow(
                          map,
                          "simple_example_window",
                          "<div><iframe src=\"" + iframeSrc + "\" scrolling=\"no\" height=\"" + height + "px\" width=\"100%\" frameborder=\"0\" marginwidth =\"0\"></iframe></div>"

                        );
            },

            fireSearch: function() {
                
                clearTimeout(mapUtil._searchTimeOut);
                if (!mapUtil.allowSearchs)
                    return;
                mapUtil._searchTimeOut = window.setTimeout(function() {
                searchs(); //alert(10);
                    map.savePosition();
                }, 500);
            }

        };

        function clearEventBubble(evt) {
            evt = evt || window.event;

            if (evt.stopPropagation) {
                evt.stopPropagation();
            } else {
                evt.cancelBubble = true;
            }

            if (evt.preventDefault) {
                evt.preventDefault();
            } else {
                evt.returnValue = false;
            }

        } 
        
    </script>
<div class="copyright">
<hr />
           2009 版权所有 CangBaoWang.net <a target="_blank" href="http://www.miibeian.gov.cn" linkindex="17">   京ICP证09059498号</a>        
    </div>



</asp:Content>
